package com.qyhl.shop.shop.list;

import com.qyhl.webtv.commonlib.entity.shop.ShopListBean;

import java.util.List;

public class ShopListPresenter implements ShopListContract.ShopListPresenter {
    private ShopListContract.ShopListView mView;
    private ShopListModel mModel;

    public ShopListPresenter(ShopListContract.ShopListView mView) {
        this.mView = mView;
        this.mModel = new ShopListModel(this);
    }

    @Override
    public void getList(int type, int page) {
        mModel.getList(type, page);
    }

    @Override
    public void setList(List<ShopListBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }

    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
